<template>
    <div>
        <h1>use axios</h1>
        <p v-if="loading">loading...</p>
        <img v-if="loaded" :src="result.message" />
    </div>
</template>
<script>
// interface DogResult {
//     message: string;
//     status: string;
// }
import { defineComponent } from 'vue';
import UseURLLoader from '../hooks/UseURLLoader';
export default defineComponent({
    setup () {
      const { result, loading, loaded } = UseURLLoader('https://dog.ceo/api/breeds/image/random')
      console.log(result.value)

      return {
          result,
          loading,
          loaded
      }
    }
})
</script>